import { InitType } from "./couponAcitonType";
import { getCoupon } from '../../request/coupon'

export const couponInitAction = (data)=>({type:InitType,data})


export const asyncInitAction = (uid)=>{
    //就是进行axios请求
    return dispatch=>{getCoupon(uid).then(res=>{
        if(res.code === 200){
            console.log(res)
            dispatch(couponInitAction(res.list))
        }
    })
    }
}